<template>
  <div>
    <a-modal
      type="primary"
      @click="showModal"
      title="测试弹框"
      @ok="handleOk"
      v-model:visible="visible"
      :maskClosable="false"
    >
    <a-spin tip="" :spinning="spinning">
      弹框
    </a-spin>
    </a-modal>
  </div>
</template>
<script lang="ts" setup>
import {ref, defineExpose} from 'vue'

const visible = ref<boolean>(false)
const spinning = ref(false)
      
const showModal = (value: Object) => {
  console.log(value, '数据')
  spinning.value = true
  visible.value = true
  setTimeout(() => {
    spinning.value = false
  }, 1000)
}

const handleOk = (e: MouseEvent) => {
  visible.value = false
}
defineExpose({
  showModal
})

</script>
<style scoped lang="scss">

</style>